import request from '@/utils/request'

// 客户信息管理接口
export const customerApi = {
  // 获取客户列表
  getList(params) {
    return request({
      url: '/customer/info/list',
      method: 'get',
      params
    })
  },
  
  // 获取客户详情
  getInfo(custId) {
    return request({
      url: `/customer/info/${custId}`,
      method: 'get'
    })
  },
  
  // 新增客户
  add(data) {
    return request({
      url: '/customer/info',
      method: 'post',
      data
    })
  },
  
  // 修改客户
  update(data) {
    return request({
      url: '/customer/info',
      method: 'put',
      data
    })
  },
  
  // 删除客户
  delete(custIds) {
    return request({
      url: `/customer/info/${custIds}`,
      method: 'delete'
    })
  },

  // 更新客户状态
  updateStatus(data) {
    return request({
      url: '/customer/info/status',
      method: 'put',
      data
    })
  },

  // 获取客户回访记录列表
  getVisitList(params) {
    return request({
      url: '/customer/visit/list',
      method: 'get',
      params
    })
  },

  // 添加回访记录
  addVisit(data) {
    return request({
      url: '/customer/visit',
      method: 'post',
      data
    })
  },

  // 删除回访记录
  deleteVisit(visitIds) {
    return request({
      url: `/customer/visit/${visitIds}`,
      method: 'delete'
    })
  },

  // 获取客户贷款记录列表
  getLoanList(params) {
    return request({
      url: '/customer/loan/list',
      method: 'get',
      params
    })
  },

  // 获取客户贷款详情
  getLoanInfo(loanId) {
    return request({
      url: `/customer/loan/${loanId}`,
      method: 'get'
    })
  }
} 